require 'crawler/blogspot_crawler'
require 'curb'

conditions = nil
conditions = ARGV[0] unless ARGV[0].nil?

crawler = Crawler::BlogspotCrawler.new :conditions => conditions, :min_dealy => 10, :max_delay => 72

p crawler

log = {:stopped => true}

begin
  log = crawler.start_crawling {|c| p c}
rescue Curl::Err::HostResolutionError => e
  p e
  delay = 60*40
  p "Time to sleep #{delay}sec"
  sleep delay
  retry
end

puts "Finis #{log}"